<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <#include "/common/_commresource.html"/>     
    <link href="${request.contextPath}/static/css/build.css" rel="stylesheet"></link>
    <link href="${request.contextPath}/static/corn/cronGen.css" rel="stylesheet"></link>
<script type="text/javascript" src="${request.contextPath}/static/corn/cronGen.js"></script>
    <title>随意论坛</title>
</head>

  <body>
    <#include "/common/_commtop.html"/> <section class="content-wrap">
        <div class="container">
            <div class="row">
            
<main class="col-md-12 main-content">
<article class="post">
	<div class="template-page-wrapper">
	<form class="form-horizontal templatemo-signin-form" role="form" id="registerform"action="jobMessage/setUpJob" method="post">
		<!-- 任务组名称start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobGroupName" class="col-sm-4 control-label">任务组名称</label>
				<div class="col-sm-3">
				<input type="text" class="form-control"
									id="jobGroupName" name="jobGroupName" placeholder="任务组名称">
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- 任务组名称end -->	
		
		<!-- 任务名称start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">任务名称</label>
				<div class="col-sm-3">
				<input type="text" class="form-control"
									id="jobName" name="jobName" placeholder="任务名称">
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- 任务名称end -->	
		
		<!-- 网站start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">网址</label>
				<div class="col-sm-3">
				<input type="text" class="form-control"
									id="web" name="web" placeholder="网址">
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- 网站end -->	
		<!-- start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">是否启用</label>
				<div class="col-sm-3">
		                    <div class="radio radio-info radio-inline">
		                        <input type="radio" id="inlineRadio1" value="1" name="runningStatus" checked>
		                        <label for="inlineRadio1"> 是 </label>
		                    </div>
		                    <div class="radio radio-inline">
		                        <input type="radio" id="inlineRadio2" value="0" name="runningStatus">
		                        <label for="inlineRadio2"> 否 </label>
		                    </div>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- end -->	
		
		<!-- start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">是否加载运行</label>
				<div class="col-sm-3">
		                    <div class="radio radio-info radio-inline">
		                        <input type="radio" id="inlineRadio3" value="1" name="loadRunning" checked>
		                        <label for="inlineRadio3"> 是 </label>
		                    </div>
		                    <div class="radio radio-inline">
		                        <input type="radio" id="inlineRadio4" value="0" name="loadRunning">
		                        <label for="inlineRadio4"> 否 </label>
		                    </div>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- end -->
			
		<!-- start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">备注</label>
				<div class="col-sm-3">
				<input type="text" class="form-control"
									id="remarker" name="remarker" placeholder="备注">
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<!-- end -->		
		
		<!-- start --> 
		<div class="form-group">
			<div class="col-md-12">
				<label for="jobName" class="col-sm-4 control-label">执行时间</label>
				<div class="col-sm-3">
				<input id="cron" class="form-control" name="cornExpress"/>
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>		    
<script type="text/javascript">
	$(function() {
	    $("#cron").cronGen({
	    	direction : 'right'
	    	});
	});
</script>
		<!-- end -->	
				
		<div class="form-group" style="margin-bottom:150px">
			<div class="col-md-3">
			</div>
			<div class="col-md-4" >
    		<button type="button" class="btn btn-danger" type="submit" style="width:60%; margin-right:5%;" onclick="setUpJob();">保存</button>
    		<a class="btn btn-warning" href="/jobMessage/jobManage" role="button" style="width:30%;">返回</a> 
			</div>
			<div class="col-md-4">
			</div>
		</div>
        
			<script type="text/javascript">
				function setUpJob(){
					var dataJson = $("#registerform").serialize();
					$.ajax({
					    type: "post",
					    dataType: 'json',
					    url: '${request.contextPath}/jobMessage/setUpJob',
					    data: dataJson,
					    success:function(data){
					    	if(data.status==200){
					    		layer.msg(data.msg, {icon: 1,time:2000});
						    }else{
						    	layer.msg(data.msg, {icon: 5,time:2000});
							}
					    }
					});
				}
			</script>
	</form>
	</div>
</article>
</main>
            </div>
        </div>
    </section>
</body>	
</html>